import 'package:bruno/bruno.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:sph_shipper/Main/Settings/PersonalInformationList.dart';

import '../../AppConfig/Config.dart';
import '../../AppConfig/RouteAct.dart';
import '../../l10n/messages.dart';
import '../ProtocolDisplay.dart';
import 'AccountAndSecurity.dart';
import 'PersonalInformationDownload.dart';

class PrivacyPolicyList extends StatefulWidget {
  const PrivacyPolicyList({super.key});

  @override
  State<PrivacyPolicyList> createState() => _PrivacyPolicyListState();
}

class _PrivacyPolicyListState extends State<PrivacyPolicyList> {
  List titleList=['收集个人信息清单','第三方合作清单','个人信息下载'];
  @override
  Widget build(BuildContext context) {
    final screenSize = MediaQuery.of(context).size;
    var messages = AppLocalizations.of(context)!;
    return Scaffold(
      backgroundColor: MyColors.backgreyColor,
      appBar: AppBar(
        leading: IconButton(icon: Icon(Icons.arrow_back_ios,color: Colors.black,),onPressed: (){Navigator.pop(context);},),
        title: Text(messages["隐私"],style: TextStyle(fontWeight: FontWeight.w300,fontSize: 16.sp),),
        centerTitle: true,
        backgroundColor: Colors.white,
      ),
      body: Container(
        margin: EdgeInsets.only(top: 8.h),
        child:
          ListView.builder(
            itemCount: titleList.length,
            itemBuilder: (context, index) {
              final item = titleList[index];
              return GestureDetector(
                child: Container(
                  padding: EdgeInsets.only(left: 10.w,right: 10.w,top: 8.h,bottom: 8.h),
                  color: Colors.white,
                  child: Column(
                    children: [
                      Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(item,style: TextStyle(color: Colors.black,fontSize: 14.sp),),
                          Icon(Icons.arrow_forward_ios,color: MyColors.authTipColor,size: 14,),
                        ],
                      ),

                      Divider(height: 1.h,color: MyColors.backgreyColor,),
                    ],
                  ),
                ),
                onTap: (){
                if(index==0)
                  Navigator.push( context, FadeRoute(page:PersonalInformationList()));
                if(index==1)
                  Navigator.push( context, FadeRoute(page:ProtocolDisplay(id: "1806571891806515202",)));
                if(index==2)
                  Navigator.push( context, FadeRoute(page:PersonalInformationDownload()));
                },
              )
                ;

            },
          ),

      ),


    );
  }
}